<?php

/**
 * This is the model class for table "Photo".
 *
 * The followings are the available columns in table 'Photo':
 * @property integer $Index
 * @property string $ProductNo
 * @property string $ProductName
 * @property string $ProductDetail
 * @property string $URL1
 * @property string $URL2
 * @property string $URL3
 * @property string $URL4
 * @property string $URL5
 * @property string $URL6
 * @property string $URL7
 * @property string $URL8
 * @property string $URL9
 * @property string $URL10
 * @property string $URL11
 * @property string $URL12
 * @property string $URL13
 */
class Photo extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return Photo the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'Photo';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ProductNo, ProductName, URL1, URL2, URL3, URL4, URL5, URL6, URL7, URL8, URL9, URL10, URL11, URL12, URL13', 'length', 'max'=>100),
			array('ProductDetail', 'length', 'max'=>1073741823),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('Index, ProductNo, ProductName, ProductDetail, URL1, URL2, URL3, URL4, URL5, URL6, URL7, URL8, URL9, URL10, URL11, URL12, URL13', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'Index' => 'Index',
			'ProductNo' => 'Product No',
			'ProductName' => 'Product Name',
			'ProductDetail' => 'Product Detail',
			'URL1' => 'Url1',
			'URL2' => 'Url2',
			'URL3' => 'Url3',
			'URL4' => 'Url4',
			'URL5' => 'Url5',
			'URL6' => 'Url6',
			'URL7' => 'Url7',
			'URL8' => 'Url8',
			'URL9' => 'Url9',
			'URL10' => 'Url10',
			'URL11' => 'Url11',
			'URL12' => 'Url12',
			'URL13' => 'Url13',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('Index',$this->Index);
		$criteria->compare('ProductNo',$this->ProductNo,true);
		$criteria->compare('ProductName',$this->ProductName,true);
		$criteria->compare('ProductDetail',$this->ProductDetail,true);
		$criteria->compare('URL1',$this->URL1,true);
		$criteria->compare('URL2',$this->URL2,true);
		$criteria->compare('URL3',$this->URL3,true);
		$criteria->compare('URL4',$this->URL4,true);
		$criteria->compare('URL5',$this->URL5,true);
		$criteria->compare('URL6',$this->URL6,true);
		$criteria->compare('URL7',$this->URL7,true);
		$criteria->compare('URL8',$this->URL8,true);
		$criteria->compare('URL9',$this->URL9,true);
		$criteria->compare('URL10',$this->URL10,true);
		$criteria->compare('URL11',$this->URL11,true);
		$criteria->compare('URL12',$this->URL12,true);
		$criteria->compare('URL13',$this->URL13,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}